<?
	require_once('init.php');
	require_once('cartClass.php');
 
 	if(!isset($_SESSION['cart'])) 
 	{ 
		$_SESSION['cart'] =serialize(new Cart()); 
	}
  
  	$cartItem=unserialize($_SESSION['cart']);

	$requestUrl=$_SERVER['REQUEST_URI'];
	$requestUrl=strrev($requestUrl);
	$i=strpos($requestUrl,'/');
	if ( strpos($requestUrl,'/') >0) 
	{			  
		$requestUrl=strrev(substr($requestUrl,0,strpos($requestUrl,'/')));
	} 
	else 
	{
		if (str_len($requestUrl)>0 ) 
		{
			$requestUrl=strrev($requestUrl);
		} 
	}
?>

<link rel="icon" type="image/x-icon"  href="images/favicon.ico"  />
<link rel="shortcut icon" type="image/x-icon" href="images/favicon.ico" />

<?
if (
   (strpos($_SERVER["HTTP_USER_AGENT"],"MSIE 5.0")) || 
   (strpos($_SERVER["HTTP_USER_AGENT"],"MSIE 6.0"))
   )
 {
?>
	<script src="Scripts/iepng.js" type="text/javascript"></script>
<?
}
?>

	<!--script src="Scripts/jquery.min.js" type="text/javascript">	</script-->
	<!--script src="Scripts/jquery.hiAlerts-min.js" type="text/javascript">	</script-->
	<!--script src="Scripts/common.js" type="text/javascript">	</script-->

	<link href="css/jquery.hiAlerts.css" rel="stylesheet" type="text/css" />
	
 <!-- 整个页头 -->

	<!--div class="topbg1" style="height:80px;background:none;"></div-->

	<div class="topbg1" >
		<div class="top_a01">
			<div class="top_b02">
			    <div class="top_a021"></div>

				<?
				$strSQL= "select id,".$strLanguage_Sort1." from sort1 where delflag<>'1' order by id ";  
				$db = MySQL::getInstance('','r-w'); 
				$DBR=$db->query($strSQL); 
				
		      	while($resort1=$db->fetch($DBR))
		    	{
		    	?>
				    <div class="top_a02"><a href="body2.php?sort1id=<?=$resort1["id"];?>"><b><?=$resort1["sort1name"];?></b></a></div>
					<div class="top_a03"><?="&nbsp;&nbsp;";?>
						<div class="top_a04"> </div>
					</div>
				<?
				}

				$Items=$cartItem->getCart();
				$dblNum=0;  //合计数量
				foreach($Items as $iItem)
				{
					$iCount=$iItem['count'];
					$dblNum=$dblNum+$iCount;  //合计数量
				} 
				?>
			    <div class="top_a02"><a href="cartdetail.php"><b><?=$strCart."(".$dblNum.")";?></b></a></div>
			</div>    

			<div class="top_b04">    <!--Logo-->
				<a href="default.php"><img style="width:250px;height:78px;" src="<?=$lng_imagepath;?>logo01.png" border="0" /></a>
			</div>
			
			<div class="top_b05">
				<?
				if ($_SESSION["userName"]=="")
				{
				?>
					<div class="top_a02" style="float:right;margin-right:20px;">
						<a href="changelanguage.php?f=<?=base64_encode($requestUrl);?>">
						<!--a href="default.php?ChangeType=1"-->
							<?
							if ($_SESSION["Language"]=="CHINESE")
							{
							?>
								<img style="width:18px;height:12px;" src="<?=$lng_imagepath;?>flag_e.jpg" border="0" />
								<b><?=" English";?></b>
							<?
							}
							else if ($_SESSION["Language"]=="ENGLISH")
							{
							?>
								<img style="width:18px;height:12px;" src="<?=$lng_imagepath;?>flag_c.jpg" border="0" />
								<b><?="简体中文";?></b>
							<?
							}
							?>	
						</a>
					</div>
					<div class="top_a03" style="float:right;"><?="&nbsp;&nbsp;";?>
						<div class="top_a04"> </div>
					</div>
					<div class="top_a02" style="float:right;"><a href="register.php"><b><?=$strregist;?></b></a></div>
					<div class="top_a03" style="float:right;"><?="&nbsp;&nbsp;";?>
						<div class="top_a04"> </div>
					</div>
					<div class="top_a02" style="float:right;"><a href="login.php"><b><?=$strlogin;?></b></a></div>
				<?
				}
				else
				{
				?>
					<div class="top_a02" style="float:right;margin-right:20px;">
						<a href="changelanguage.php?f=<?=base64_encode($requestUrl);?>">
							<?
							if ($_SESSION["Language"]=="CHINESE")
							{
							?>
								<img style="width:18px;height:12px;" src="<?=$lng_imagepath;?>flag_e.jpg" border="0" />
								<b><?=" English";?></b>
							<?
							}
							else if ($_SESSION["Language"]=="ENGLISH")
							{
							?>
								<img style="width:18px;height:12px;" src="<?=$lng_imagepath;?>flag_c.jpg" border="0" />
								<b><?="简体中文";?></b>
							<?
							}
							?>	
						</a>
					</div>
					<div class="top_a03" style="float:right;"><?="&nbsp;&nbsp;";?>
						<div class="top_a04"> </div>
					</div>
					<div class="top_a02" style="float:right;"><a href="logout.php"><b><?=$strexit;?><b></a></div>
					<div class="top_a03" style="float:right;"><?="&nbsp;&nbsp;";?>
						<div class="top_a04"> </div>
					</div>		
					<div class="top_a02" style="float:right;"><a href="mangercenter.php"><b><?=$strmangercenter;?><b></a></div>
					
					
					<!--div class="top_a03" style="float:right;"><?="&nbsp&nbsp;";?>
						<div class="top_a04"> </div>
					</div>				
					<div class="top_a02" style="float:right;color:#0080C0;"><b><?=$strmemberid.":".$_SESSION["UID"];?><b></div-->
				<?
				}
				?>
				
			</div>
		</div>		 
	</div>
 